﻿
@{
    Layout = null;
}

<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>管理员登录-后台管理系统-AeAdmin 1.0</title>
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link rel="shortcut icon" href="~/images/favicon.ico" type="image/x-icon" />
    <link rel="stylesheet" href="~/css/font.css">
    <link rel="stylesheet" href="~/css/weadmin.css">
    <script src="~/lib/layui/layui.js" charset="utf-8"></script>

</head>
<body class="login-bg">

    <div class="login">
        <div class="message">AeAdmin 1.0-管理登录</div>
        <div id="darkbannerwrap"></div>

        <form id="form1" method="post" class="layui-form">
            <input name="UserName" placeholder="用户名" type="text" lay-verify="required" class="layui-input">
            <hr class="hr15">
            <input name="Password" lay-verify="required" placeholder="密码" type="password" class="layui-input">
            <hr class="hr15">
            <span>
            <input name="PIN" placeholder="验证码" value="" type="text" class="layui-inline" style="width:65%;margin-right:5px;">
                <img src="/Admin/Home/MixVerifyCode" id="PINImg" style="width:30%;height:50px;" onclick="refresh()" />
            </span>
            <hr class="hr15">
            <input name="ReturnUrl" placeholder="跳转页面" value="@Html.Raw(ViewBag.ReturnUrl)" type="hidden" class="layui-input">
            <input class="loginin" value="登录" lay-submit lay-filter="login" style="width:100%;" type="submit">
            <hr class="hr20">
            <div>
                asp.net core 2.0 CMS系统 Power by jomzhang  Blog:https://www.cnblogs.com/jomzhang/
            </div>
        </form>
    </div>

    <script type="text/javascript">

        layui.extend({
            admin: '{/}/js/admin'
        });
        layui.use(['form', 'admin', 'jquery'], function () {
            var form = layui.form
                , admin = layui.admin
                , $ = layui.jquery;
  
            //监听提交
            form.on('submit(login)', function (data) {
                $.post("DoLogin", $('#form1').serialize(), function (res) {
                    if (res.success) {
                        window.location.href = res.msg;
                    }
                    else {
                        layer.alert(res.msg);
                        if (res.msg == "验证码错误") {
                            refresh();
                        }
                    }
                }, "json");
                return false;
            });
        });
        function refresh() {
            var id = document.getElementById("PINImg");
            var str = "/Admin/Home/MixVerifyCode?random=" + Math.random();
            id.setAttribute("src", str);
        }
    </script>
    <!-- 底部结束 -->
</body>
</html>